import demo1.OutClass;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-05-19
 * Time: 12:27
 */
class Out{
    public void test() {
        //局部内部类，只能在次方法里使用
        class Innerclass {
            int a = 1;
            public void test2() {
                System.out.println(a);
            }
        }
        //实例化局部内部类
        Innerclass innerclass = new Innerclass();
        innerclass.test2();
    }
}

public class Test {
    public static void main(String[] args) {
        //err
//        OutClass.Innerclass innerclass = new Innerclass;
    }
}
